package de.fuberlin.kosmik.gui.view;


import android.app.Activity;
import android.app.Dialog;
import android.util.Pair;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import de.fuberlin.kosmik.R;
import de.fuberlin.kosmik.gui.dialog.Dialogs;
import org.mapsforge.android.maps.ArrayItemizedOverlay;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Set;

public class PoiItemizedOverlay extends ArrayItemizedOverlay {


	private Activity activity;

	public PoiItemizedOverlay(Activity activity) {
		super(null, activity);
		this.activity = activity;

	}

	@Override
	protected boolean onTap(int index) {

		OverlayPoiItem overlayPoiItem =  (OverlayPoiItem)createItem(index);

		Set<String> keySet = overlayPoiItem.poi.values.keySet();

		StringBuilder message = new StringBuilder();
		message.append(activity.getResources().getString(R.string.pois_display_message));
		message.append("\n");
		int i = 0;
		for (String key : keySet){
			message.append(key).append(" = ").append(overlayPoiItem.poi.values.getString(key)).append("\n");
		}

		Dialogs.confirmMessage(message.toString(),activity);


		return true;
	}
}
